<?php

	$SESSION_NAME = "PHPAUCTION_SESSION";
	session_name($SESSION_NAME);
	session_start();


  	//-- This is the directory where users pictures will be uploaded - requires ending slash
  	$uploaded_path = "uploaded/";
  	#$uploaded_path = "uploaded\\";

	//--
  	$MAX_UPLOAD_SIZE = 100000;


	//-- This string is added to passwords before generating the MD5 hash
	//-- Be sure to never change it after the firt set up or
	//-- your users passwords will not work
	$MD5_PREFIX = "put_here_along_and_unpredictable_string";


  	/*
  		This is the log file generated by cron.php - insert the complete
  		file name (including the absolute path).
  		If you don't want to generate a log file for cron activity simply
  		leave this line commented.
  	*/
  	#$logFileName = "/var/www/auctions/logs/cron.log";
  	#$logFileName = "C:\\path\\to\cron.log";


	/*
		Set this to TRUE if you want cron to generates HTML output
		BESIDES the cron file declared above. cron.php cannot generates
		only HTML output.
	*/
  	$cronScriptHTMLOutput = FALSE;
  	$expireAuction = 60*60*24*30; // time of auction expiration (in seconds)


  /*======================================================================
   *																							  *
   * Don't edit the code below unless you really know what you are doing  *
   *																							  *
   ======================================================================*/

	//--
  if(strpos($_SERVER['PHP_SELF'], "control/")){
  	$password_file = "../config.php";
  } else {
  	$password_file = "config.php";
  }


  include($password_file);

 //-- Database connection

  if(!mysql_connect($DbHost,$DbUser,$DbPassword))
  {
  	$NOTCONNECTED = TRUE;
  }
  if(!mysql_select_db($DbDatabase))
  {
  	$NOTCONNECTED = TRUE;
  }

  #// RETRIEVE SETTINGS AND CREATE SESSION VARIABLES FOR THEM
	if(strpos($_SERVER['PHP_SELF'], "control/"))
	{
		include "../includes/fonts.inc.php";
		include "../includes/fontcolor.inc.php";
		include "../includes/fontsize.inc.php";
	}
	else
	{
		include "includes/fonts.inc.php";
		include "includes/fontcolor.inc.php";
		include "includes/fontsize.inc.php";
	}

  	$query = "select * from PHPAUCTION_settings";
  	$RES = @mysql_query($query);

  	if($RES)
  	{
  		$SETTINGS = mysql_fetch_array($RES);

  		$std_font = "<FONT FACE=".$FONTS[substr($SETTINGS[std_font],0,1)]."
  					 SIZE=".$FONTSIZE[substr($SETTINGS[std_font],1,1)]."
  					 COLOR=".$FONTCOLOR[substr($SETTINGS[std_font],2,1)].">";
  		if(substr($SETTINGS[std_font],3,1) == 1)
  		{
  			$std_font .= "<B>";
  		}
  		if(substr($SETTINGS[std_font],4,1) == 1)
  		{
  			$std_font .= "<I>";
  		}

  		$nav_font = "<FONT FACE=".$FONTS[substr($SETTINGS[nav_font],0,1)]."
  					 SIZE=".$FONTSIZE[substr($SETTINGS[nav_font],1,1)]."
  					 COLOR=".$FONTCOLOR[substr($SETTINGS[nav_font],2,1)].">";

  		if(substr($SETTINGS[nav_font],3,1) == 1)
  		{
  			$nav_font .= "<B>";
  		}
  		if(substr($SETTINGS[nav_font],4,1) == 1)
  		{
  			$nav_font .= "<I>";
  		}

  		$footer_font = "<FONT FACE=".$FONTS[substr($SETTINGS[footer_font],0,1)]."
  					 SIZE=".$FONTSIZE[substr($SETTINGS[footer_font],1,1)]."
  					 COLOR=".$FONTCOLOR[substr($SETTINGS[footer_font],2,1)].">";

  		if(substr($SETTINGS[footer_font],3,1) == 1)
  		{
  			$footer_font .= "<B>";
  		}
  		if(substr($SETTINGS[footer_font],4,1) == 1)
  		{
  			$footer_font .= "<I>";
  		}

  		$tlt_font = "<FONT FACE=".$FONTS[substr($SETTINGS[tlt_font],0,1)]."
  					 SIZE=".$FONTSIZE[substr($SETTINGS[tlt_font],1,1)]."
  					 COLOR=".$FONTCOLOR[substr($SETTINGS[tlt_font],2,1)].">";

  		if(substr($SETTINGS[tlt_font],3,1) == 1)
  		{
  			$tlt_font .= "<B>";
  		}
  		if(substr($SETTINGS[tlt_font],4,1) == 1)
  		{
  			$tlt_font .= "<I>";
  		}

  		$err_font = "<FONT FACE=".$FONTS[substr($SETTINGS[err_font],0,1)]."
  					 SIZE=".$FONTSIZE[substr($SETTINGS[err_font],1,1)]."
  					 COLOR=".$FONTCOLOR[substr($SETTINGS[err_font],2,1)].">";

  		if(substr($SETTINGS[err_font],3,1) == 1)
  		{
  			$err_font .= "<B>";
  		}
  		if(substr($SETTINGS[err_font],4,1) == 1)
  		{
  			$err_font .= "<I>";
  		}

  		$sml_font = "<FONT FACE=".$FONTS[substr($SETTINGS[sml_font],0,1)]."
  					 SIZE=".$FONTSIZE[substr($SETTINGS[sml_font],1,1)]."
  					 COLOR=".$FONTCOLOR[substr($SETTINGS[sml_font],2,1)].">";

  		if(substr($SETTINGS[sml_font],3,1) == 1)
  		{
  			$sml_font .= "<B>";
  		}
  		if(substr($SETTINGS[sml_font],4,1) == 1)
  		{
  			$sml_font .= "<I>";
  		}


 		session_name($SESSION_NAME);
  		session_register("SETTINGS","std_font");
  	}



  if(strpos($_SERVER['PHP_SELF'], "control/"))
  {
  	include("../includes/currency.inc.php");
  }
  else
  {
  	include("./includes/currency.inc.php");
  }

?>